<template>
  <div class="callKeepDetail">
    <x-header class="header" :left-options="{showBack: showHeaderBack}" ref="header">呼叫存酒详情</x-header>
    <div class="topHolder"></div>
    <group title="备注(选填)：">
      <x-textarea :max="200" v-model="remark" placeholder="点击输入"></x-textarea>
    </group>
    <box gap="1rem 0.8rem">
      <x-button :gradients="['#FF2719', '#FF61AD']" @click.native="submit" :show-loading="loadingStatus" :disabled="loadingStatus" text="提交"></x-button>
    </box>
  </div>
</template>

<script>
  import { Group, XTextarea, Box, XButton } from 'vux'
  import {submitCallService} from "../../api";
  import {message} from "../../common/util";

  export default {
    name:'callKeepDetail',
    data(){
      return{
        showHeaderBack:this.GLOBAL.showHeaderBack,
        loadingStatus:false,
        paramTableId:this.$route.params.tableId,
        remark:''
      }
    },
    components:{
      Group,
      XTextarea,
      Box,
      XButton
    },
    computed:{

    },
    methods:{
      submit(){
        let reqParams = {
          remark:this.remark,
          type:'',
          tableId:this.paramTableId
        }
        submitCallService(reqParams).then((res)=>{
          if(res.status == 'success'){
            message({message:'呼叫存酒成功',type:'info'})
            this.$router.push({name:'扫码操作',params:{tableId:this.paramTableId}})
          }else if(res.status == 'error') {
            message({message:res.msg,type:'error'})
            console.log('submitCallService error info:', res.msg)
          }
          this.loadingStatus = false
        }).catch((err)=>{console.log('submitCallService catch info:',err)})
      }
    },
    mounted(){
      this.$store.commit('updateLoadingStatus',{isLoading:false})
    }
  }
</script>

<style lang="scss" scoped>
  .callKeepDetail{
  }
</style>
